<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var names = ["abc", "cba", "nba", "mba"]
    /**
     * slice不会修改原数组
     * splice会修改原数组
     * start从什么位置开始
     * end 结束位置,不包含end本身
    */
    var newNames = names.slice(2, 4)
    console.log(newNames)

    var names1 = ["abc", "cba"]
    var names2 = ["nba", "mba"]
    var names3 = ["why", "kobe"]
    var newNames2 = names1.concat(names2, names3)
    console.log(newNames2)

    console.log(names.join("-"))

  </script>
</body>

</html>